
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
cdk-fargate-run-task
Advanced tools
Define and run container tasks on AWS Fargate immediately or with schedule
Define and run container tasks on AWS Fargate at once or by schedule.
const app = new cdk.App();
const env = {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
};
const stack = new cdk.Stack(app, 'run-task-demo-stack', { env });
// define your task
const task = new ecs.FargateTaskDefinition(stack, 'Task', { cpu: 256, memoryLimitMiB: 512 });
// add contianer into the task
task.addContainer('Ping', {
image: ecs.ContainerImage.fromRegistry('busybox'),
command: [
'sh', '-c',
'ping -c 3 google.com',
],
logging: new ecs.AwsLogDriver({
streamPrefix: 'Ping',
logGroup: new LogGroup(stack, 'LogGroup', {
logGroupName: `${stack.stackName}LogGroup`,
retention: RetentionDays.ONE_DAY,
}),
}),
});
// deploy and run this task once
const runTaskAtOnce = new RunTask(stack, 'RunDemoTaskOnce', { task });
// or run it with schedule(every hour 0min)
new RunTask(stack, 'RunDemoTaskEveryHour', {
task,
cluster: runTaskAtOnce.cluster,
runOnce: false,
schedule: Schedule.cron({ minute: '0' }),
});
To run task in public subnets only VPC:
new RunTask(stack, 'RunTask', {
task,
vpcSubnets: {
subnetType: ec2.SubnetType.PUBLIC,
},
Amazon ECS Anywhere allows you to run ECS tasks on external instances. To run external task once or on schedule:
const externalTask = new ecs.TaskDefinition(stack, 'ExternalTask', {
cpu: '256',
memoryMiB: '512',
compatibility: ecs.Compatibility.EXTERNAL,
});
externalTask.addContainer('ExternalPing', {
image: ecs.ContainerImage.fromRegistry('busybox'),
command: [
'sh', '-c',
'ping -c 3 google.com',
],
logging: new ecs.AwsLogDriver({
streamPrefix: 'Ping',
logGroup: new LogGroup(stack, 'ExternalLogGroup', {
retention: RetentionDays.ONE_DAY,
removalPolicy: cdk.RemovalPolicy.DESTROY,
}),
}),
});
// run it once on external instance
new RunTask(stack, 'RunDemoTaskFromExternal', {
task: externalTask,
cluster: existingCluster,
launchType: LaunchType.EXTERNAL,
});
// run it by schedule on external instance
new RunTask(stack, 'RunDemoTaskFromExternalSchedule', {
task: externalTask,
cluster: existingCluster,
launchType: LaunchType.EXTERNAL,
runAtOnce: false,
schedule: Schedule.cron({ minute: '0' }),
});
Please note when you run task in EXTERNAL
launch type, no fargate tasks will be scheduled. You will be responsible to register the external instances to your ECS cluster. See Registering an external instance to a cluster for more details.
FAQs
Define and run container tasks on AWS Fargate immediately or with schedule
The npm package cdk-fargate-run-task receives a total of 340 weekly downloads. As such, cdk-fargate-run-task popularity was classified as not popular.
We found that cdk-fargate-run-task demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.